package com.oromwin.repos.server.response.volume;

import java.io.DataInputStream;
import java.io.IOException;

import org.apache.commons.logging.Log;

import com.oromwin.repos.common.Logger;
import com.oromwin.repos.common.ReposException;
import com.oromwin.repos.common.helper.IOHelper;
import com.oromwin.repos.data.VolumeTable;
import com.oromwin.repos.server.response.NormalResponse;

public class InfoVolumeResponse extends NormalResponse {
    private Log log = Logger.getLog(InfoVolumeResponse.class);
    private VolumeTable volumeTable = null;
    public void receive(DataInputStream dis) throws ReposException {
        try {
            Result = dis.readBoolean();
            Description = IOHelper.readUTF8(dis);
            String volumeId = IOHelper.readUTF8(dis);
            String volumeName = IOHelper.readUTF8(dis);
            Boolean volumeStatus = new Boolean(dis.readBoolean());
            String createDate = IOHelper.readUTF8(dis);
            String updateDate = IOHelper.readUTF8(dis);
            volumeTable = new VolumeTable(volumeId, volumeName, volumeStatus, createDate, updateDate);
        } catch (IOException e) {
            throw ReposException.create(log, e);
        }
    }
    public VolumeTable getVolumeTable() {
        return volumeTable;
    }
}
